home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / GRAPHICS.SWG / 0010_Including BGI in EXE.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  3KB  |  108 lines

  1. {
  2. RANDY PARKER
  3.  
  4. > Does anyone out there knwo how you can compile a Program using one of
  5. > Borland's BGI units for grpahics and not have to distribute the BGI
  6. > file(s) with the EXE?
  7.  
  8.    First, convert the BGI and CHR files to .OBJ files (object) by using
  9. BINOBJ.EXE.  You may just want to clip out the following and name it as a batch
  10. file.
  11.  
  12.    BINOBJ.EXE goth.chr goth gothicfontproc
  13.    BINOBJ.EXE litt.chr litt smallfontproc
  14.    BINOBJ.EXE sans.chr sans sansseriffontproc
  15.    BINOBJ.EXE trip.chr trip triplexfontproc
  16.    BINOBJ.EXE cga.bgi cga cgadriverproc
  17.    BINOBJ.EXE egavga.bgi egavga egavgadriverproc
  18.    BINOBJ.EXE herc.bgi herc hercdriverproc
  19.    BINOBJ.EXE pc3270.bgi pc3270 pc3270driverproc
  20.    BINOBJ.EXE at.bgi att attdriverproc
  21.  
  22.    You should now have the following files:
  23.  
  24.      ATT.OBJ, CGA.OBJ, EGAVGA.OBJ GOTH.OBJ HERC.OBJ LITT.OBJ PC3270.OBJ,
  25.      SANS.OBJ, TRIP.OBJ.
  26. }
  27.  
  28. unit GrDriver;
  29.  
  30. interface
  31.  
  32. uses Graph;
  33.  
  34. implementation
  35.  
  36. procedure ATTDriverProc;    External; {$L ATT.OBJ}
  37. procedure CGADriverProc;    External; {$L CGA.OBJ}
  38. procedure EGAVGADriverProc; External; {$L EGAVGA.OBJ}
  39. procedure HercDriverProc;   External; {$L HERC.OBJ}
  40. procedure PC3270DriverProc; External; {$L PC3270.OBJ}
  41.  
  42. procedure ReportError(s : string);
  43. begin
  44.   writeln;
  45.   writeln(s, ': ', GraphErrorMsg(GraphResult));
  46.   Halt(1);
  47. end;
  48.  
  49. begin
  50.   if RegisterBGIdriver(@ATTDriverProc) < 0 then
  51.     ReportError('AT&T');
  52.   if RegisterBGIdriver(@CGADriverProc) < 0 then
  53.     ReportError('CGA');
  54.   if RegisterBGIdriver(@EGAVGADriverProc) < 0 then
  55.     ReportError('EGA-VGA');
  56.   if RegisterBGIdriver(@HercDriverProc) < 0 then
  57.     ReportError('Hercules');
  58.   if RegisterBGIdriver(@PC3270DriverProc) < 0 then
  59.     ReportError('PC-3270');
  60. end.
  61.  
  62.  
  63. unit GrFont;
  64.  
  65. interface
  66.  
  67. uses
  68.   Graph;
  69.  
  70. implementation
  71.  
  72. procedure GothicFontProc;    External; {$L GOTH.OBJ}
  73. procedure SansSerifFontProc; External; {$L SANS.OBJ}
  74. procedure SmallFontProc;     External; {$L LITT.OBJ}
  75. procedure TriplexFontProc;   External; {$L TRIP.OBJ}
  76.  
  77. procedure ReportError(s : string);
  78. begin
  79.   writeln;
  80.   writeln(s, ' font: ', GraphErrorMsg(GraphResult));
  81.   halt(1)
  82. end;
  83.  
  84. begin
  85.   if RegisterBGIfont(@GothicFontProc) < 0 then
  86.     ReportError('Gothic');
  87.   if RegisterBGIfont(@SansSerifFontProc) < 0 then
  88.     ReportError('SansSerif');
  89.   if RegisterBGIfont(@SmallFontProc) < 0 then
  90.     ReportError('Small');
  91.   if RegisterBGIfont(@TriplexFontProc) < 0 then
  92.     ReportError('Triplex');
  93. end.
  94.  
  95. {
  96. By using the 2 units above, you should be able to include any video driver
  97. of font (that were listed) by simply inserting
  98.  
  99. Uses
  100.   GrFont, GrDriver, Graph;
  101.  
  102. into your graphic files.
  103.  
  104. I got this out of a book name Mastering Turbo Pascal 6, by Tom Swan. It's an
  105. excellent book that covers from Turbo 4.0 to 6.0, basics to advanced subjects.
  106. Hope it works for you.
  107. }
  108.